--functions useful while defining scriptParams to be used in scripts.lua

function setWeaponPieces (weaponNum, turret, sleeve, barrel, firepoint)
  local weapon = scriptParams.weapons[weaponNum]
  if (type(weapon) ~= "table") then return end
  weapon.turret = turret
  weapon.sleeve = sleeve
  weapon.barrel = barrel
  weapon.firepoint = firepoint
end 